## Rings Zn

from PyM import *


A = Zn(35)

# 43 mod 35, an integer
show(43 % 35)

# 43 mod 35, as an element of A
a = 43>>A
show(a)

# some opperation in A
show(a**3 + 5*a**7)

show(geometric_series(a,12))


# Computation of inverses
x = 25>>Zn(17)

y = 1/x

show((x, y, x*y))


#inverse(a)
show(1/a)

b = 7>>A

show(is_invertible(b))

try:
    show(1/b)
except(ZeroDivisionError):
    show("This number is not invertible")



